<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});


// 后台管理
Route::group(['prefix' => 'myadmin', 'namespace' => 'Admin'], function () {
    Route::any("/login", 'LoginController@index');
    Route::any("/login_out", 'LoginController@loginOut');

    // 首页
    Route::get("/", 'IndexController@index');
    Route::get("/index", 'IndexController@index');
    Route::get("/panle", 'IndexController@panel');

    // 用户管理
    Route::get("/user/get_list", 'UsersController@getList');
    Route::post("/user/change_status", 'UsersController@changeStatus');
    Route::post("/user/delete", 'UsersController@delete');

    // 管理员
    Route::post("/admin/change_password", 'AdminsController@changePassword');

    // 基础设置
    Route::get("/config/get_list", 'ConfigController@getList');
    Route::any("/config/add", 'ConfigController@add');
    Route::any("/config/edit", 'ConfigController@edit');
    Route::post("/config/delete", 'ConfigController@delete');
});

// 测试
Route::group(['prefix' => 'test', 'namespace' => 'Test'], function () {
    Route::any("/index", 'TestController@index');

});